import java.util.UUID

/*
* @ author: karim daher
* @ date: 04-28-2008
* @version: 0.1
 */

class Invitation {
    Date     dateCreated
    Date     lastUpdated
    String   inviter
    String   invited
    String   message = "For version 1: to send invitation to a freind, please copy the code above and send it to your freind by email,"+
            "so she/he can enter it while registering"
    boolean  expired = false
    String   code  // = UUID.randomUUID().toString()

    static constraints={
        invited(email:true)
        message(widget:'text', maxSize:300, blank:true,nullable:true)
    }

   def beforeInsert = {
       dateCreated = new Date()
   }
   def beforeUpdate = {
       lastUpdated = new Date()
   }
}